.class public Lweibo4android/UserTrend;
.super Lweibo4android/WeiboResponse;
.source "UserTrend.java"


# static fields
.field private static final serialVersionUID:J = 0x1aba5f6b262a250aL


# instance fields
.field private hotword:Ljava/lang/String;

.field private num:Ljava/lang/String;

.field private trend_id:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 27
    invoke-direct {p0}, Lweibo4android/WeiboResponse;-><init>()V

    .line 19
    iput-object v0, p0, Lweibo4android/UserTrend;->hotword:Ljava/lang/String;

    .line 20
    iput-object v0, p0, Lweibo4android/UserTrend;->trend_id:Ljava/lang/String;

    .line 28
    return-void
.end method

.method public constructor <init>(Lweibo4android/http/Response;)V
    .locals 5
    .parameter "res"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    const/4 v2, 0x0

    .line 30
    invoke-direct {p0, p1}, Lweibo4android/WeiboResponse;-><init>(Lweibo4android/http/Response;)V

    .line 19
    iput-object v2, p0, Lweibo4android/UserTrend;->hotword:Ljava/lang/String;

    .line 20
    iput-object v2, p0, Lweibo4android/UserTrend;->trend_id:Ljava/lang/String;

    .line 31
    invoke-virtual {p1}, Lweibo4android/http/Response;->asJSONObject()Lweibo4android/org/json/JSONObject;

    move-result-object v1

    .line 33
    .local v1, json:Lweibo4android/org/json/JSONObject;
    :try_start_0
    const-string v2, "num"

    invoke-virtual {v1, v2}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lweibo4android/UserTrend;->num:Ljava/lang/String;

    .line 34
    const-string v2, "hotword"

    invoke-virtual {v1, v2}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lweibo4android/UserTrend;->hotword:Ljava/lang/String;

    .line 35
    const-string v2, "trend_id"

    invoke-virtual {v1, v2}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lweibo4android/UserTrend;->trend_id:Ljava/lang/String;

    .line 36
    const-string v2, "topicid"

    invoke-virtual {v1, v2}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    if-eqz v2, :cond_0

    .line 37
    const-string v2, "topicid"

    invoke-virtual {v1, v2}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lweibo4android/UserTrend;->trend_id:Ljava/lang/String;
    :try_end_0
    .catch Lweibo4android/org/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 42
    :cond_0
    return-void

    .line 38
    :catch_0
    move-exception v0

    .line 39
    .local v0, je:Lweibo4android/org/json/JSONException;
    new-instance v2, Lweibo4android/WeiboException;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Lweibo4android/org/json/JSONException;->getMessage()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v4, ":"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v1}, Lweibo4android/org/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3, v0}, Lweibo4android/WeiboException;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V

    throw v2
.end method

.method public constructor <init>(Lweibo4android/org/json/JSONObject;)V
    .locals 4
    .parameter "json"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    const/4 v1, 0x0

    .line 43
    invoke-direct {p0}, Lweibo4android/WeiboResponse;-><init>()V

    .line 19
    iput-object v1, p0, Lweibo4android/UserTrend;->hotword:Ljava/lang/String;

    .line 20
    iput-object v1, p0, Lweibo4android/UserTrend;->trend_id:Ljava/lang/String;

    .line 45
    :try_start_0
    const-string v1, "num"

    invoke-virtual {p1, v1}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lweibo4android/UserTrend;->num:Ljava/lang/String;

    .line 46
    const-string v1, "hotword"

    invoke-virtual {p1, v1}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lweibo4android/UserTrend;->hotword:Ljava/lang/String;

    .line 47
    const-string v1, "trend_id"

    invoke-virtual {p1, v1}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lweibo4android/UserTrend;->trend_id:Ljava/lang/String;
    :try_end_0
    .catch Lweibo4android/org/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 52
    return-void

    .line 48
    :catch_0
    move-exception v0

    .line 49
    .local v0, je:Lweibo4android/org/json/JSONException;
    new-instance v1, Lweibo4android/WeiboException;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Lweibo4android/org/json/JSONException;->getMessage()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p1}, Lweibo4android/org/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2, v0}, Lweibo4android/WeiboException;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V

    throw v1
.end method

.method static constructTrendList(Lweibo4android/http/Response;)Ljava/util/List;
    .locals 8
    .parameter "res"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lweibo4android/http/Response;",
            ")",
            "Ljava/util/List",
            "<",
            "Lweibo4android/UserTrend;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 56
    :try_start_0
    invoke-virtual {p0}, Lweibo4android/http/Response;->asJSONArray()Lweibo4android/org/json/JSONArray;

    move-result-object v2

    .line 57
    .local v2, list:Lweibo4android/org/json/JSONArray;
    invoke-virtual {v2}, Lweibo4android/org/json/JSONArray;->length()I

    move-result v3

    .line 58
    .local v3, size:I
    new-instance v5, Ljava/util/ArrayList;

    invoke-direct {v5, v3}, Ljava/util/ArrayList;-><init>(I)V

    .line 59
    .local v5, trends:Ljava/util/List;,"Ljava/util/List<Lweibo4android/UserTrend;>;"
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    if-lt v0, v3, :cond_0

    .line 62
    return-object v5

    .line 60
    :cond_0
    new-instance v6, Lweibo4android/UserTrend;

    invoke-virtual {v2, v0}, Lweibo4android/org/json/JSONArray;->getJSONObject(I)Lweibo4android/org/json/JSONObject;

    move-result-object v7

    invoke-direct {v6, v7}, Lweibo4android/UserTrend;-><init>(Lweibo4android/org/json/JSONObject;)V

    invoke-interface {v5, v6}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Lweibo4android/org/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lweibo4android/WeiboException; {:try_start_0 .. :try_end_0} :catch_1

    .line 59
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 63
    .end local v0           #i:I
    .end local v2           #list:Lweibo4android/org/json/JSONArray;
    .end local v3           #size:I
    .end local v5           #trends:Ljava/util/List;,"Ljava/util/List<Lweibo4android/UserTrend;>;"
    :catch_0
    move-exception v1

    .line 64
    .local v1, jsone:Lweibo4android/org/json/JSONException;
    new-instance v6, Lweibo4android/WeiboException;

    invoke-direct {v6, v1}, Lweibo4android/WeiboException;-><init>(Ljava/lang/Exception;)V

    throw v6

    .line 65
    .end local v1           #jsone:Lweibo4android/org/json/JSONException;
    :catch_1
    move-exception v4

    .line 66
    .local v4, te:Lweibo4android/WeiboException;
    throw v4
.end method


# virtual methods
.method public getHotword()Ljava/lang/String;
    .locals 1

    .prologue
    .line 77
    iget-object v0, p0, Lweibo4android/UserTrend;->hotword:Ljava/lang/String;

    return-object v0
.end method

.method public getNum()Ljava/lang/String;
    .locals 1

    .prologue
    .line 71
    iget-object v0, p0, Lweibo4android/UserTrend;->num:Ljava/lang/String;

    return-object v0
.end method

.method public getTrend_id()Ljava/lang/String;
    .locals 1

    .prologue
    .line 83
    iget-object v0, p0, Lweibo4android/UserTrend;->trend_id:Ljava/lang/String;

    return-object v0
.end method

.method public setHotword(Ljava/lang/String;)V
    .locals 0
    .parameter "hotword"

    .prologue
    .line 80
    iput-object p1, p0, Lweibo4android/UserTrend;->hotword:Ljava/lang/String;

    .line 81
    return-void
.end method

.method public setNum(Ljava/lang/String;)V
    .locals 0
    .parameter "num"

    .prologue
    .line 74
    iput-object p1, p0, Lweibo4android/UserTrend;->num:Ljava/lang/String;

    .line 75
    return-void
.end method

.method public setTrend_id(Ljava/lang/String;)V
    .locals 0
    .parameter "trend_id"

    .prologue
    .line 86
    iput-object p1, p0, Lweibo4android/UserTrend;->trend_id:Ljava/lang/String;

    .line 87
    return-void
.end method

.method public toString()Ljava/lang/String;
    .locals 2

    .prologue
    .line 90
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "Trend [num="

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v1, p0, Lweibo4android/UserTrend;->num:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ", hotword="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lweibo4android/UserTrend;->hotword:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ", trend_id="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 91
    iget-object v1, p0, Lweibo4android/UserTrend;->trend_id:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "]"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 90
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method
